<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<div class="pad-lr-10">
<form name="searchform" action="?m=s_certificate&c=manage&a=init" method="get">
		<input type="hidden" value=s_certificate name="m"> 
		<input type="hidden" value="manage" name="c"> 
		<input type="hidden" value="init" name="a">
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
				<tr>
					<td>
						<div class="explain-col">
							<?php echo L('name')?>:<input name="name" class="input-text" value="<?php echo $_GET['name']?>" type="text" size="15">
							<?php echo L('identification')?>:<input name="identification" class="input-text" value="<?php echo $_GET['identification']?>" type="text" size="20"> 
							<?php echo L('certificate_number')?>:<input name="certificate_number" class="input-text" value="<?php echo $_GET['certificate_number']?>" type="text" size="15"> 
							校区：<select name="train_school">
								<option value="" selected="">请选择学区</option>
								<?php foreach($this->train_school as $k=>$v){?>
								<option value="<?php echo $v;?>" <?php if($v==$train_school){echo 'selected';}?>><?php echo $v;?></option>
								<?php }?>
								</select>
							学级：<select name="train_level">
								<option value="" selected="">请选择学级</option>
								<?php foreach($this->train_level as $k=>$v){?>
								<option value="<?php echo $v;?>" <?php if($v==$train_level){echo 'selected';}?>><?php echo $v;?></option>
								<?php }?>
								</select>
							&nbsp;&nbsp;&nbsp;<input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit">
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
<form name="myform" action="?m=s_certificate&c=manage&a=del" method="post" onsubmit="return confirm('<?php echo L('confirm')?>')">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th  align="center" width="20"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
			<th align="center">ID</th>
			<th align="center"><?php echo L('name')?></th>
			<th align="center"><?php echo L('gender')?></th>
			<th align="center"><?php echo L('identification')?></th>
			<th align="center"><?php echo L('image_home')?></th>
			<th align="center"><?php echo L('train_type')?></th>
			<th align="center"><?php echo L('train_rank')?></th>
			<th align="center"><?php echo L('train_level')?></th>
			<th align="center"><?php echo L('train_school')?></th>
			<th align="center"><?php echo L('train_year')?></th>
			<th align="center"><?php echo L('certificate_number')?></th>
			<th align="center"><?php echo L('create_time')?></th>
			<th align="center"><?php echo L('updated_by')?></th>
			<th align="center"><?php echo L('operation')?></th>
		</tr>
	</thead>
<tbody>
<?php
if(!empty($certificate_info)){
	foreach($certificate_info as $k=>$v) {
?>
    <tr>
		<td align="center"><input type="checkbox" value="<?php echo $v['id']?>" name="id[]"></td>
		<td align="center"><?php echo $v['id']?></td>
		<td align="center"><?php echo $v['name']?$v['name']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php if($v['gender'] == '1'){echo '男';}elseif($v['gender'] == '2'){echo '女';}elseif($v['gender'] == '3'){echo '保密';}?></td>
		<td align="center"><?php echo $v['identification']?$v['identification']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php if(!empty($v['image_home'])){echo '<img src="'.$v['image_home'].'" height="80px">';}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center"><?php echo $v['train_type']?$v['train_type']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php echo $v['train_rank']?$v['train_rank']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php echo $v['train_level']?$v['train_level']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php echo $v['train_school']?$v['train_school']:'<font color="red">（未设置）</font>';?></td>
		<td align="center"><?php if(!empty($v['train_year'])){echo $v['train_year'];}else{echo '<font color="red">（未设置）</font>';};?></td>
		<td align="center"><?php if(!empty($v['certificate_number'])){echo $v['certificate_number'];}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center"><?php if(!empty($v['create_time'])){echo str_cut($v['create_time'],15,'');}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center"><?php echo $v["username"];?></td>
		<td align="center">
		<a href="?m=s_certificate&c=manage&a=edit&id=<?php echo $v['id']?>"><?php echo L('edit');?></a>&nbsp;|&nbsp;
		<a href="?m=s_certificate&c=manage&a=del&id=<?php echo $v['id']?>&name=<?php echo $v['name'];?>" onClick="return confirm('<?php echo L('confirm')?>')"><?php echo L('del')?></a>
		</td>
    </tr>
<?php
	}
} else {
?>
	<tr><td colspan='15' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>
<?php }?>
</tbody>
</table>

<div class="btn">
<label for="check_box"><a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('select_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a></label> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>"/>
</div>

<div id="pages"><?php echo $pages?></div>
</div>
</form>
</div>
</body>
</html>